package com.insleton.admin;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableTransactionManagement // 启用注解事务. 不起作用啊
// 这个扫描实体类，如果实体类和spring boot主类包不在一个包路径下，需要配置扫描的包路径
// 如果不添加扫描包，出现 Unable to locate persister: com.cyyz.tai.model.DashPoint
@EntityScan(basePackages = { "com.insleton.admin", "com.cyyz.tai" })
// 扫描仓库接口
@EnableJpaRepositories(basePackages = { "com.insleton.admin", "com.cyyz.tai" })
// scanBasePackages 包含com.vteba会出现缺少javax.HttpServletRequest，里面引用了旧的包
@SpringBootApplication(exclude = { FreeMarkerAutoConfiguration.class }, scanBasePackages = { "com.insleton.admin", "com.cyyz.tai" })
// @SpringBootApplication(exclude = { FreeMarkerAutoConfiguration.class })
public class InsletonAdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(InsletonAdminApplication.class, args);
    }

}
